import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router"
import { store } from "@/store"
import nprogress from "nprogress"
import "nprogress/nprogress.css"

const routes: Array<RouteRecordRaw> = [
  // {
  //   path: "/",
  //   redirect: "/home",
  // },
  // {
  //   path: "/:pathMatch(.*)*",
  //   redirect: "/",
  // },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes,
})

//nprogress 配置
nprogress.configure({
  easing: "ease",
  speed: 500,
  trickleSpeed: 200,
  showSpinner: false,
})

router.beforeEach((to, from, next) => {
  nprogress.start()
  next()
})
router.afterEach(() => {
  nprogress.done()
})

export default router
